#ifndef _PBVP_PERPIXELLIGHTINGRENDER_H
#define _PBVP_PERPIXELLIGHTINGRENDER_H

#include "../../renderer/geometryrenderplugin.h"
#include "../../renderer/GLSLProgram.h"

namespace PBVP {
	class Environment;
	///
	class PerpixelLightingRender : public QObject, public GeometryRenderPlugin
	{
		Q_OBJECT
		Q_INTERFACES(PBVP::RenderPlugin)
	public:
		///
		PerpixelLightingRender();
		///
		~PerpixelLightingRender();

		/// 
		void initialize(MainInterface* mainInterface /* = NULL */);

		/// 
		virtual QString name() const {
			return QString("PPL Renderer");
		}
		virtual QString description() const {
			return QString("Per Pixel Lighting Renderer using GLSL Shader");
		}
		/// 
		virtual RenderPlugin* clone();
		/// 
		virtual bool initRender();
		/// Is given data type supported by the renderer
		virtual bool isSupported(DataInterface *pData) const;
		/// Begin the rendering using this Renderer
		/** 
		* This function sets up rendering attributes before each rendering
		*/
		virtual void begin(); 
		/// End the rendering of the current Renderer
		virtual void end();
		/// Rendering function
		virtual void render(DataNode* pDataNode);

	private:
		counted_ptr<GLSLProgram> m_pProgram;
		Environment* m_pEnv;
	};
}
#endif // PERPIXELLIGHTINGRENDER_H
